package com.ydm.fire_fighting_web.modules.index.mapper;

import com.ydm.fire_fighting_web.entity.index.EventInformation;
import com.ydm.fire_fighting_web.entity.index.FireFightingEquipment;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface IndexMapper {
    @Select("SELECT count(*) FROM `fire_fighting_equipment` where status=#{status}")
    Integer findStatus(Integer status);
    @Select("SELECT * FROM `fire_fighting_equipment` where createTime >#{parse} and status=1 ORDER BY createTime DESC limit 10")
    List<FireFightingEquipment> findTOPTenEquipment(String parse);
    @Select("SELECT * FROM `event_information` where createTime >#{format} ORDER BY createTime DESC limit 10")
    List<EventInformation> findTenEventInformation(String format);
    @Select("SELECT * FROM fire_fighting_equipment where status!=0")
    List<FireFightingEquipment> findAllBadEquipment();
}
